package com.wanxi.controller;

import java.util.ArrayList;
import java.util.Scanner;

public class MyArrayStringFor {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            System.out.println("请输入第" + (i + 1) + "个元素");
            list.add(scanner.next());
        }
        for (int i = 0; i < list.size(); i++) {
            System.out.println("第" + (i + 1) + "个元素为:" + list.get(i));
        }
    }
}
